package com.oms.module.merchant.constant;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

import java.util.Objects;

/**
 * @Deacription TODO
 * @Author Ananda
 * @Date 2020/9/2 18:44
 * @QQ 38592077
 **/
public enum AuditResultEnum {
    NOT_SUBMITTED(0,"未提交"),
    UNAUDITED(10,"未审核"),
    NOT_THROUGH(20,"未通过"),
    VIA(30,"通过"),
    BANNED(40,"封禁")
    ;
    @EnumValue
    private Integer code;
    @JsonValue
    private String desc;
    public String getDesc(){
        return desc;
    }
    public Integer getCode(){
        return code;
    }

    private AuditResultEnum(Integer code, String desc) {
        this.desc = desc;
        this.code = code;
    }

//    @JsonCreator
//    public static AuditResultEnum getByCode(int code) {
//        for (AuditResultEnum value : AuditResultEnum.values()) {
//            if (Objects.equals(code, value.getCode())) {
//                return value;
//            }
//        }
//        return null;
//    }
}
